Optimal. Leaf size=28 \[ \frac {b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {(a-b) \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3757, 396, 212}
\begin {gather*} \frac {(a-b) \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 396
Rule 3757
Rubi steps
\begin {align*} \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a-(a-b) x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {(a-b) \sin (c+d x)}{d}+\frac {b \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {(a-b) \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 47, normalized size = 1.68 \begin {gather*} \frac {b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a \cos (d x) \sin (c)}{d}+\frac {a \cos (c) \sin (d x)}{d}-\frac {b \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 39, normalized size = 1.39
method | result | size |
derivativedivides | \(\frac {b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+\sin \left (d x +c \right ) a}{d}\) | \(39\) |
default | \(\frac {b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+\sin \left (d x +c \right ) a}{d}\) | \(39\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} a}{2 d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} b}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a}{2 d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} b}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b}{d}\) | \(103\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 46, normalized size = 1.64 \begin {gather*} \frac {b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 2 \, a \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.12, size = 44, normalized size = 1.57 \begin {gather*} \frac {b \log \left (\sin \left (d x + c\right ) + 1\right ) - b \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (a - b\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 48, normalized size = 1.71 \begin {gather*} \frac {b {\left (\log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - 2 \, \sin \left (d x + c\right )\right )} + 2 \, a \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.87, size = 32, normalized size = 1.14 \begin {gather*} \frac {\sin \left (c+d\,x\right )\,\left (a-b\right )}{d}+\frac {2\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________